#pragma once
#include <map>

class IFunctioner
{
public:
    virtual LONG run(HANDLE hFun, PEXCEPTION_POINTERS pEI){ return EXCEPTION_CONTINUE_SEARCH;};
};

class CDetect
{
public:
    struct sHookFun
    {
        CString Name;
        IFunctioner* fun;
        BYTE CC;
    };
    typedef std::map<HANDLE, sHookFun> MapHook;
    
    CDetect();
    ~CDetect();
    void AddHook(HANDLE hookAddress, sHookFun & hookFun);
    void RemoveHook(HANDLE hookAddress);
private:
    static MapHook m_mapMapHook;
    static HANDLE m_hVectorHander;
    static LONG WINAPI VectoredHandler(PEXCEPTION_POINTERS ExceptionInfo);
    static CRITICAL_SECTION m_CriticalSection;
};